package com.dhcc.bpm.modules.desk.wrapper;

import com.dhcc.bpm.common.cache.DictCache;
import com.dhcc.bpm.modules.desk.entity.Notice;
import com.dhcc.bpm.modules.desk.vo.NoticeVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;

/**
 * @ClassName NoticeWrapper.class
 * @Description  Notice包装类,返回视图层所需的字段
 * @Author YZC
 * @Date 2020-02-03 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
public class NoticeWrapper extends BaseEntityWrapper<Notice, NoticeVO> {

	public static NoticeWrapper build() {
		return new NoticeWrapper();
	}

	@Override
	public NoticeVO entityVO(Notice notice) {
		NoticeVO noticeVO = BeanUtil.copy(notice, NoticeVO.class);
		String dictValue = DictCache.getValue("notice", noticeVO.getCategory().toString());
		noticeVO.setCategoryName(dictValue);
		return noticeVO;
	}

}
